<template>
	<view class="vr">
		<scroll-view class="vr-scroll-view" scroll-x @scrolltolower="scrolltolower">
			<view class="vr-list">
				<view class="vr-item" v-for="(data,index) in list" :key="index" @click="goVrInfo(isVr?data.vr_id:data.goods_id,isVideo?data.video_id:'')">
					<view class="vr-item-image">
						<image class="icon" :src="icon" mode="aspectFit" v-if="icon"></image>
						<image mode="aspectFill" :src="data.image"></image>
					</view>
					<view class="vr-title" v-if="!isVideo">{{isVr?data.vr_name:data.case_name}}</view>
					<view class="vr-title" v-else>{{data.name}}</view>
					<view class="vr-des" v-if="!isVideo">
						<text>{{data.style_name}}</text>
						<text>{{data.space}}</text>
						<text>{{data.square}}㎡</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props: {
			isVideo: {
				type: Boolean,
				default () {
					return false
				}
			},
			icon: '',
			isVr: {
				type: Boolean,
				default () {
					return false
				}
			},
			showIcon: {
				type: Boolean,
				default () {
					return false
				}
			},
			list: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			goVrInfo(type,video_id){
				this.$emit('Func',type || video_id)
			},
			scrolltolower(){
				this.$emit('scrolltolower')
			}
		}
	}
</script>

<style lang="scss">
	.vr-scroll-view{
		
	}
	.vr-list{
		white-space: nowrap;
		padding: 0 30rpx 40rpx;
	}
	.vr-item{
		display: inline-block;
		width: 570rpx;
		border-radius: 16rpx;
		margin-right: 30rpx;
		box-shadow: 0rpx 20rpx 40rpx 0 rgba(40,34,31,0.05);
	}
	.vr-item-image{
		position: relative;
		.icon{
			position: absolute;
			width: 72rpx;
			height: 72rpx;
			top: 50%;
			left: 50%;
			transform: translate(-50%,-50%);
			z-index: 1;
		}
	}
	.vr-item image{
		width: 100%;
		border-radius: 16rpx 16rpx 0 0;
	}
	.vr-title{
		text-align: center;
		font-size: 36rpx;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 30rpx 20rpx;
	}
	.vr-des{
		font-size: 24rpx;
		color: #9F9F9C;
		text-align: center;
		padding-bottom: 30rpx;
		text{
			margin: 0 10rpx;
		}
	}
</style>